package com.web.ShoppingDemo.action;

import org.apache.struts2.StrutsSpringTestCase;
import org.junit.Test;

import com.opensymphony.xwork2.ActionProxy;
public class CategoryActionTest extends StrutsSpringTestCase{

	@Test
	public void testUpdate() {
		ActionProxy proxy = null;
		CategoryAction action = null;
		
		request.setParameter("category.type", "体育");
		//request.setParameter("category.hot", "true");
		
		proxy = getActionProxy("/category_update.action");
		
		action = (CategoryAction) proxy.getAction();
		try{
			String result = action.execute();
			assertEquals("success",result);
		}catch(Exception e){
			e.printStackTrace();
		}
		//action.getXXX();
		assertEquals("体育",action.model.getType());
		//assertEquals(true,action.getCategory().getHot());
	}

}
